home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6657 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: hermes.oc.com!usenet
  2. From: Larry Weiss <lfw@oc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: && operator question
  5. Date: Thu, 15 Feb 1996 15:50:49 -0600
  6. Organization: OpenConnect Systems, Dallas, TX, USA
  7. Message-ID: <3123AAB9.FBE@oc.com>
  8. References: <4fu69a$b7e@sphinx.Gsu.EDU> <31236240.1417@oc.com> <fcusack-1502961453260001@mudskipper.cac.psu.edu>
  9. NNTP-Posting-Host: ocs2228.oc.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14. CC: lfw@oc.com
  15.  
  16. frank. wrote:
  17.  > 
  18.  > In article <31236240.1417@oc.com>, Larry Weiss <lfw@oc.com> wrote:
  19.  > 
  20.  > > Matthew A Johnson wrote:
  21.  > >  > if(expression1 && expression2)
  22.  > >  >      some statement;
  23.  > >  > My question is, if expression1 is false will expression2 get evaluated at
  24.  > >  > all?
  25.  
  26.  > > No.   Why do you ask that question here?
  27.  
  28.  > Why wouldn't he ask it here? It is a C question...
  29.  
  30.  
  31. I am trying to understand why someone would go to the trouble (and have the
  32. patience) to ask such a trivial question that could easily be answered by
  33. consultation to any C language textbook.    
  34.  
  35. I have a slightly hidden agenda as well by posting this reply in the newsgroup
  36. ....that is the general education of the infrequent readers of this group....
  37. that such simple questions should first be resolved privately.     Or at least, 
  38. disquise the question in sheep's clothing....for example:
  39.  
  40.    Why is C designed to require short circuit evaluation with respect to
  41.    some operators (for instance &&) ?    
  42.  
  43.    Isn't C somewhat unique in mandating short circuit evaluation for the
  44.    logical AND (&&) operator?  BASIC and FORTRAN don't do this.
  45.  
  46.    Why did the designers of C mandate the short circuit evaluation of the
  47.    && operator?
  48.  
  49. That way, you'll be quickly informed if your assumption is incorrect
  50. (you get to ask the question) and be much less likely to get "educated"
  51. about the nettiquete issues.   You also just might learn some background
  52. about the C language, as well as the operational realities.   But better
  53. by far to just read a book (you'll get the answer instantly).
  54.